import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';

/**
 * Generated class for the MemberPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage({
  name: 'member',
  segment: 'member'
})
@Component({
  selector: 'page-member',
  templateUrl: 'member.html',
})
export class MemberPage {
  barCode: string = '';

  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  // 返回
  back() {
    this.navCtrl.pop();
  }
  // 键盘
  keyboard(value) {
    if (value == 'clean') {
      this.barCode = '';
    } else if (value == 'back') {
      this.barCode = this.barCode.slice(0, -1);
    } else {
      this.barCode += value;
    }
  }
}
